<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
	<head>
		<title>Init From XML String</title>
		<meta http-equiv="content-type" content="text/html; charset=utf-8" />
		<meta name="featured" content="yes"><meta name="title" content="Samples" />
		<meta name="keywords" content="" />
		<meta name="description" content="" />
		<link rel="icon" href="../common/favicon.ico" type="image/x-icon" />
		<link rel="shortcut icon" href="../common/favicon.ico" type="image/x-icon" />
		<link rel="stylesheet" href="../common/css/style.css" type="text/css" media="screen" />

	</head>
	<body onload="doOnLoad();">
        <div class="header">
            <a class="logo" href="http://www.dhtmlx.com" title="DHTMLX homepage"></a>
            <div class="tittle-dhtmlx">DHTMLX Docs & Samples Explorer</div>
            <div class="search-field">
                <form action="http://docs.dhtmlx.com/doku.php" accept-charset="utf-8" id="dw__search"><div class="no"><input type="hidden" name="do" value="search" /><input type="text" id="qsearch__in" accesskey="f" name="id" title="Search" /><input class="button" type="submit" value=""><div id="qsearch__out" class="ajax_qsearch JSpopup"></div></div></form>
            </div>
            <div class="buttons">
                <a class="doc_inact" href="../../../docsExplorer/index.html" title="DHTMLX Documentation homepage"></a>
                <a class="sample"></a>
            </div>
        </div>
        <div class="content">
            <div class="navigation-div">
                <a href="../../../docsExplorer/samples.html" class="navigation"><img src="../common/icons/file.gif" alt="" >All components</a>
                <div class="arrow"></div>
                <a href="../index.html" class="navigation"><img height="22" src="../common/icons/form.gif" alt="" >dhtmlxForm</a>
                <div class="arrow"></div>
                <a href="./index.html" class="navigation"><img src="../common/icons/none.gif" alt="" >Init</a>
            </div>
            <div style="display:block;">
                <h3>Init From XML String</h3>
            </div>
            <div class="navigation-div">
                <a href="#code" class="navigation view-source"><img src="../common/icons/source.gif" alt="" >View page source</a>
            </div>
            <link rel="stylesheet" type="text/css" href="../../codebase/skins/dhtmlxform_dhx_skyblue.css">
	<script src="../../codebase/dhtmlxcommon.js"></script>
	<script src="../../codebase/dhtmlxform.js"></script>
	<script>
		var myForm;
		function doOnLoad() {
			var formXMLString = '<items>'+
						'<item type="settings" position="label-left" labelWidth="100" inputWidth="120"/>'+
						'<item type="fieldset" name="data" inputWidth="auto" label="Welcome">'+
							'<item type="radio" name="type" labelWidth="auto" position="label-right" checked="true" label="Already have account">'+
								'<item type="input" value="p_rossi" label="Login"/>'+
								'<item type="password" value="123" label="Password"/>'+
								'<item type="checkbox" checked="true" label="Remember me"/>'+
							'</item>'+
							'<item type="radio" name="type" labelWidth="auto" position="label-right" label="Not registered yet">'+
								'<item type="input" value="Patricia D. Rossi" label="Full Name"/>'+
								'<item type="input" value="p_rossi@example.com" label="E-mail Address"/>'+
								'<item type="input" value="p_rossi" label="Login"/>'+
								'<item type="password" value="123" label="Password"/>'+
								'<item type="password" value="123" label="Confirm Password"/>'+
								'<item type="checkbox" label="Subscribe on news"/>'+
							'</item>'+
							'<item type="radio" name="type" labelWidth="auto" position="label-right" label="Guest login">'+
								'<item type="select" label="Account type">'+
									'<option value="admin" label="Admin"/>'+
									'<option value="org" label="Organiser"/>'+
									'<option value="poweruser" label="Power User"/>'+
									'<option value="user" label="User"/>'+
								'</item>'+
								'<item type="checkbox" label="Show logs window"/>'+
							'</item>'+
							'<item type="button" value="Proceed"/>'+
						'</item>'+
					'</items>';
			
			myForm = new dhtmlXForm("myForm");
			myForm.loadStructString(formXMLString);
		}
	</script>


	<div id="myForm" style="height:500px;"></div>
			
			
         </div>
    <div style="clear:both;"></div>
    <div class="source">
        <div class="teg">Source</div>
        <div class="code" id="code">
		<div class="hl-main"><pre><span class="hl-brackets">&lt;</span><span class="hl-reserved">link</span><span class="hl-code"> </span><span class="hl-var">rel</span><span class="hl-code">=</span><span class="hl-quotes">&quot;</span><span class="hl-string">stylesheet</span><span class="hl-quotes">&quot;</span><span class="hl-code"> </span><span class="hl-var">type</span><span class="hl-code">=</span><span class="hl-quotes">&quot;</span><span class="hl-string">text/css</span><span class="hl-quotes">&quot;</span><span class="hl-code"> </span><span class="hl-var">href</span><span class="hl-code">=</span><span class="hl-quotes">&quot;</span><span class="hl-string">../../codebase/skins/dhtmlxform_dhx_skyblue.css</span><span class="hl-quotes">&quot;</span><span class="hl-brackets">&gt;</span><span class="hl-code">
    </span><span class="hl-brackets">&lt;</span><span class="hl-reserved">script</span><span class="hl-code"> </span><span class="hl-var">src</span><span class="hl-code">=</span><span class="hl-quotes">&quot;</span><span class="hl-string">../../codebase/dhtmlxcommon.js</span><span class="hl-quotes">&quot;</span><span class="hl-brackets">&gt;</span><span class="hl-brackets">&lt;/</span><span class="hl-reserved">script</span><span class="hl-brackets">&gt;</span><span class="hl-code">
    </span><span class="hl-brackets">&lt;</span><span class="hl-reserved">script</span><span class="hl-code"> </span><span class="hl-var">src</span><span class="hl-code">=</span><span class="hl-quotes">&quot;</span><span class="hl-string">../../codebase/dhtmlxform.js</span><span class="hl-quotes">&quot;</span><span class="hl-brackets">&gt;</span><span class="hl-brackets">&lt;/</span><span class="hl-reserved">script</span><span class="hl-brackets">&gt;</span><span class="hl-code">
    </span><span class="hl-brackets">&lt;</span><span class="hl-reserved">script</span><span class="hl-brackets">&gt;</span><span class="hl-code"><div class="hl-main"><pre><span class="hl-reserved">var</span><span class="hl-code"> </span><span class="hl-identifier">myForm</span><span class="hl-code">;
</span><span class="hl-reserved">function</span><span class="hl-code"> </span><span class="hl-identifier">doOnLoad</span><span class="hl-brackets">(</span><span class="hl-brackets">)</span><span class="hl-code"> </span><span class="hl-brackets">{</span><span class="hl-code">
    </span><span class="hl-reserved">var</span><span class="hl-code"> </span><span class="hl-identifier">formXMLString</span><span class="hl-code"> = </span><span class="hl-quotes">'</span><span class="hl-string">&lt;items&gt;</span><span class="hl-quotes">'</span><span class="hl-code"> + </span><span class="hl-quotes">'</span><span class="hl-string">&lt;item type=&quot;settings&quot; position=&quot;label-left&quot; labelWidth=&quot;100&quot; inputWidth=&quot;120&quot;/&gt;</span><span class="hl-quotes">'</span><span class="hl-code"> + </span><span class="hl-quotes">'</span><span class="hl-string">&lt;item type=&quot;fieldset&quot; name=&quot;data&quot; inputWidth=&quot;auto&quot; label=&quot;Welcome&quot;&gt;</span><span class="hl-quotes">'</span><span class="hl-code"> + </span><span class="hl-quotes">'</span><span class="hl-string">&lt;item type=&quot;radio&quot; name=&quot;type&quot; labelWidth=&quot;auto&quot; position=&quot;label-right&quot; checked=&quot;true&quot; label=&quot;Already have account&quot;&gt;</span><span class="hl-quotes">'</span><span class="hl-code"> + </span><span class="hl-quotes">'</span><span class="hl-string">&lt;item type=&quot;input&quot; value=&quot;p_rossi&quot; label=&quot;Login&quot;/&gt;</span><span class="hl-quotes">'</span><span class="hl-code"> + </span><span class="hl-quotes">'</span><span class="hl-string">&lt;item type=&quot;password&quot; value=&quot;123&quot; label=&quot;Password&quot;/&gt;</span><span class="hl-quotes">'</span><span class="hl-code"> + </span><span class="hl-quotes">'</span><span class="hl-string">&lt;item type=&quot;checkbox&quot; checked=&quot;true&quot; label=&quot;Remember me&quot;/&gt;</span><span class="hl-quotes">'</span><span class="hl-code"> + </span><span class="hl-quotes">'</span><span class="hl-string">&lt;/item&gt;</span><span class="hl-quotes">'</span><span class="hl-code"> + </span><span class="hl-quotes">'</span><span class="hl-string">&lt;item type=&quot;radio&quot; name=&quot;type&quot; labelWidth=&quot;auto&quot; position=&quot;label-right&quot; label=&quot;Not registered yet&quot;&gt;</span><span class="hl-quotes">'</span><span class="hl-code"> + </span><span class="hl-quotes">'</span><span class="hl-string">&lt;item type=&quot;input&quot; value=&quot;Patricia D. Rossi&quot; label=&quot;Full Name&quot;/&gt;</span><span class="hl-quotes">'</span><span class="hl-code"> + </span><span class="hl-quotes">'</span><span class="hl-string">&lt;item type=&quot;input&quot; value=&quot;p_rossi@example.com&quot; label=&quot;E-mail Address&quot;/&gt;</span><span class="hl-quotes">'</span><span class="hl-code"> + </span><span class="hl-quotes">'</span><span class="hl-string">&lt;item type=&quot;input&quot; value=&quot;p_rossi&quot; label=&quot;Login&quot;/&gt;</span><span class="hl-quotes">'</span><span class="hl-code"> + </span><span class="hl-quotes">'</span><span class="hl-string">&lt;item type=&quot;password&quot; value=&quot;123&quot; label=&quot;Password&quot;/&gt;</span><span class="hl-quotes">'</span><span class="hl-code"> + </span><span class="hl-quotes">'</span><span class="hl-string">&lt;item type=&quot;password&quot; value=&quot;123&quot; label=&quot;Confirm Password&quot;/&gt;</span><span class="hl-quotes">'</span><span class="hl-code"> + </span><span class="hl-quotes">'</span><span class="hl-string">&lt;item type=&quot;checkbox&quot; label=&quot;Subscribe on news&quot;/&gt;</span><span class="hl-quotes">'</span><span class="hl-code"> + </span><span class="hl-quotes">'</span><span class="hl-string">&lt;/item&gt;</span><span class="hl-quotes">'</span><span class="hl-code"> + </span><span class="hl-quotes">'</span><span class="hl-string">&lt;item type=&quot;radio&quot; name=&quot;type&quot; labelWidth=&quot;auto&quot; position=&quot;label-right&quot; label=&quot;Guest login&quot;&gt;</span><span class="hl-quotes">'</span><span class="hl-code"> + </span><span class="hl-quotes">'</span><span class="hl-string">&lt;item type=&quot;select&quot; label=&quot;Account type&quot;&gt;</span><span class="hl-quotes">'</span><span class="hl-code"> + </span><span class="hl-quotes">'</span><span class="hl-string">&lt;option value=&quot;admin&quot; label=&quot;Admin&quot;/&gt;</span><span class="hl-quotes">'</span><span class="hl-code"> + </span><span class="hl-quotes">'</span><span class="hl-string">&lt;option value=&quot;org&quot; label=&quot;Organiser&quot;/&gt;</span><span class="hl-quotes">'</span><span class="hl-code"> + </span><span class="hl-quotes">'</span><span class="hl-string">&lt;option value=&quot;poweruser&quot; label=&quot;Power User&quot;/&gt;</span><span class="hl-quotes">'</span><span class="hl-code"> + </span><span class="hl-quotes">'</span><span class="hl-string">&lt;option value=&quot;user&quot; label=&quot;User&quot;/&gt;</span><span class="hl-quotes">'</span><span class="hl-code"> + </span><span class="hl-quotes">'</span><span class="hl-string">&lt;/item&gt;</span><span class="hl-quotes">'</span><span class="hl-code"> + </span><span class="hl-quotes">'</span><span class="hl-string">&lt;item type=&quot;checkbox&quot; label=&quot;Show logs window&quot;/&gt;</span><span class="hl-quotes">'</span><span class="hl-code"> + </span><span class="hl-quotes">'</span><span class="hl-string">&lt;/item&gt;</span><span class="hl-quotes">'</span><span class="hl-code"> + </span><span class="hl-quotes">'</span><span class="hl-string">&lt;item type=&quot;button&quot; value=&quot;Proceed&quot;/&gt;</span><span class="hl-quotes">'</span><span class="hl-code"> + </span><span class="hl-quotes">'</span><span class="hl-string">&lt;/item&gt;</span><span class="hl-quotes">'</span><span class="hl-code"> + </span><span class="hl-quotes">'</span><span class="hl-string">&lt;/items&gt;</span><span class="hl-quotes">'</span><span class="hl-code">;
 
    </span><span class="hl-identifier">myForm</span><span class="hl-code"> = </span><span class="hl-reserved">new</span><span class="hl-code"> </span><span class="hl-identifier">dhtmlXForm</span><span class="hl-brackets">(</span><span class="hl-quotes">&quot;</span><span class="hl-string">myForm</span><span class="hl-quotes">&quot;</span><span class="hl-brackets">)</span><span class="hl-code">;
    </span><span class="hl-identifier">myForm</span><span class="hl-code">.</span><span class="hl-identifier">loadStructString</span><span class="hl-brackets">(</span><span class="hl-identifier">formXMLString</span><span class="hl-brackets">)</span><span class="hl-code">;
</span><span class="hl-brackets">}</span></pre></div></span><span class="hl-brackets">&lt;/</span><span class="hl-reserved">script</span><span class="hl-brackets">&gt;</span><span class="hl-code">
 
 
    </span><span class="hl-brackets">&lt;</span><span class="hl-reserved">div</span><span class="hl-code"> </span><span class="hl-var">id</span><span class="hl-code">=</span><span class="hl-quotes">&quot;</span><span class="hl-string">myForm</span><span class="hl-quotes">&quot;</span><span class="hl-code"> </span><span class="hl-var">style</span><span class="hl-code">=</span><span class="hl-quotes">&quot;</span><span class="hl-string">height:500px;</span><span class="hl-quotes">&quot;</span><span class="hl-brackets">&gt;</span><span class="hl-brackets">&lt;/</span><span class="hl-reserved">div</span><span class="hl-brackets">&gt;</span></pre></div>
        </div>
    <div class="footer">
        <div class="footer-logo"></div>
        <div class="copyright">Copyright &copy; 1998-2012 DHTMLX LTD.<br />All rights reserved.</div>
    </div>
	</body>
</html>